package org.rowan.infovis.soccer;

/**
 * PURPOSE: This class represents the table data for a single sports player.
 *          The data consists of a 2D array of values with accessor methods to
 *          extract values based on the given row index
 *
 * EXAMPLE OF TABLE LAYOUT:
 *      Kick     HBall   Throw   Trap    Tack    Drib    Foot    BallP
        A        B       C       D       E       F       G       H       precision
        L        L       L       L       L       L       L       L       fluency
        L        L       L       L       L       L       L       L       coordination
        L        L       L       L       L       L       L       L       easiness
        L        L       L       L       L       L       L       L       rapidity

        I        J       K       M       N       O       P       R       tacticalUtility

        S(L)     T(L)    U(L)    V(L)    X(L)    Y(L)    Z(L)    W(L)    footMistakes
        a(L)     b(L)    c(L)    d(L)    e(L)    f(L)    g(L)    h(L)    torsoMistakes
        L        L       L       L       L       L       L       L       slow execution
 * @author Ben Hample
 * @date 11-27-09
 */
public class PlayerData {
    // GENERAL PLAYER VARIABLES

    private String teamName;
    private String firstName;
    private String lastName;
    double[][] dataArray = new double[8][9]; //[COLUMN][ROW]

    public PlayerData(String fn, String ln) {
        this.firstName = fn;
        this.lastName = ln;
    }

    public double getPrecisionData(int column) {
        return dataArray[column - 1][0];
    }

    public void setPrecisionData(int column, double precisionData) {
        dataArray[column - 1][0] = precisionData;
    }

    public int getFluencyData(int column) {
        return (int) dataArray[column - 1][1];
    }

    public void setFluencyData(int column, double fluencyData) {
        dataArray[column - 1][1] = fluencyData;
    }

    public int getCoordinationData(int column) {
        return (int) dataArray[column - 1][2];
    }

    public void setCoordinationData(int column, double coordinationData) {
        dataArray[column - 1][2] = coordinationData;
    }

    public int getEasinessData(int column) {
        return (int) dataArray[column - 1][3];
    }

    public void setEasinessData(int column, double easinessData) {
        dataArray[column - 1][3] = easinessData;
    }

    public int getRapidityData(int column) {
        return (int) dataArray[column - 1][4];
    }

    public void setRapidityData(int column, double rapidityData) {
        dataArray[column - 1][4] = rapidityData;
    }

    public int getTacticalUtilityData(int column) {
        return (int) dataArray[column - 1][5];
    }

    public void setTacticalUtilityData(int column, double tacticalData) {
        dataArray[column - 1][5] = tacticalData;
    }

    public int getFootMistakesData(int column) {
        return (int) dataArray[column - 1][6];
    }

    public void setFootMistakesData(int column, double footMistakesData) {
        dataArray[column - 1][6] = footMistakesData;
    }

    public int getTorsoMistakesData(int column) {
        return (int) dataArray[column - 1][7];
    }

    public void setTorsoMistakesData(int column, double torsoMistakesData) {
        dataArray[column - 1][7] = torsoMistakesData;
    }

    public int getSlowExecutionData(int column) {
        return (int) dataArray[column - 1][8];
    }

    public void setSlowExecutionData(int column, double slowExecutionData) {
        dataArray[column - 1][8] = slowExecutionData;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String name) {
        this.teamName = name;
    }
    
    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void displayPlayerData() {
      //  System.out.println("Player Name: " + getPlayerName());
      //  System.out.println("Team Name: " + getTeamName());
        for (int i = 0; i <= 8; i++) //EACH ROW
        {
            String rowData = "";
            for (int j = 0; j <= 7; j++) //EACH COLUMN
            {
                if (j == 0) {
                    rowData = "" + dataArray[j][i];
                } else {
                    rowData = rowData + " " + dataArray[j][i];
                }
            }
            System.out.println(rowData); //Print out each row
        }
    }
}
